
*main models*
xtreg Alt_Diff_kill_log  lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Diff_con.doc", word dec(2) label replace
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Diff_con.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log  lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Diff_con.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Diff_con.doc", word dec(2) label append

*figures*
xtreg alt_log_majkill Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
estimates store Majkill
xtreg alt_log_minkill Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
estimates store Minkill

coefplot Majkill Minkill, keep(Fav4)

nbreg alt_majattacks Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
estimates store Maja
nbreg alt_minattacks Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
estimates store Mina

coefplot Maja Mina, keep(Fav4)


xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
estimates store Diffkill
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
estimates store Diffattacks

coefplot Diffkill Diffattacks

*substantive*
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
margins, at(Fav4 = (0 1 2))
marginsplot

xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
margins, at(Fav4 = (0 1 2))
marginsplot


*robustness checks
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, fe
outreg2 using "FE.doc", word dec(2) label replace
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, fe
outreg2 using "FE.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   ethnic logpop logland loggdp polity religion intensity, mle
outreg2 using "ethnic.doc", word dec(2) label replace
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   ethnic logpop logland loggdp polity religion intensity, mle
outreg2 using "ethnic.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o    logpop logland loggdp polity religion intensity if RAScountry != "Bahrain" & RAScountry != "Syria", mle
outreg2 using "minorityrule.doc", word dec(2) label replace

xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o    logpop logland loggdp polity religion intensity if RAScountry != "Bahrain" & RAScountry != "Syria", mle
outreg2 using "minorityrule.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o    logpop logland loggdp polity religion intensity if RAScountry != "Afghanistan" & RAScountry != "Iraq", mle
outreg2 using "AfgIrq.doc", word dec(2) label replace

xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o    logpop logland loggdp polity religion intensity if RAScountry != "Afghanistan" & RAScountry != "Iraq", mle
outreg2 using "AfgIrq.doc", word dec(2) label append

xtmixed Alt_Diff_kill_log Fav4 loggdp polity intensity mxx_o lxx_o|| ccode: logpop logland religion, mle
outreg2 using "RandomCOef.doc", word dec(2) label replace
xtmixed Alt_Diff_attacks_log Fav4 loggdp polity intensity mxx_o lxx_o|| ccode: logpop logland religion, mle
outreg2 using "RandomCOef.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o    logpop logland loggdp democracy religion intensity, mle
outreg2 using "DD.doc", word dec(2) label replace
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o    logpop logland loggdp democracy religion intensity, mle
outreg2 using "DD.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o    logpop logland loggdp PTS_A religion intensity, mle
outreg2 using "PTS.doc", word dec(2) label replace

xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o    logpop logland loggdp PTS_A religion intensity, mle
outreg2 using "PTS.doc", word dec(2) label append

xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity rdi intensity, mle
outreg2 using "Altrel.doc", word dec(2) label replace
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity dominant intensity, mle
outreg2 using "Altrel.doc", word dec(2) label append
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity multiple intensity, mle
outreg2 using "Altrel.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity rdi intensity, mle
outreg2 using "Altrel.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity dominant intensity, mle
outreg2 using "Altrel.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity multiple intensity, mle
outreg2 using "Altrel.doc", word dec(2) label append


xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity freefair religion intensity, mle
outreg2 using "Altdemoc.doc", word dec(2) label replace
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity indep religion intensity, mle
outreg2 using "Altdemoc.doc", word dec(2) label append

xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity freefair religion intensity, mle
outreg2 using "Altdemoc.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity indep religion intensity, mle
outreg2 using "Altdemoc.doc", word dec(2) label append

xtreg alt_log_majkill  lxx_o mxx_o  logpop logland loggdp polity religion intensity, mle
outreg2 using "Kill_c.doc", word dec(2) label replace
xtreg alt_log_majkill Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Kill_c.doc", word dec(2) append label
xtreg alt_log_minkill  lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Kill_c.doc", word dec(2) append label
xtreg alt_log_minkill Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, mle
outreg2 using "Kill_c.doc", word dec(2) append label


nbreg alt_majattacks lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
outreg2 using "Attacks_c.doc", word dec(2) replace label
nbreg alt_majattacks Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
outreg2 using "Attacks_c.doc", word dec(2) append label
nbreg alt_minattacks lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
outreg2 using "Attacks_c.doc", word dec(2) append label
nbreg alt_minattacks Fav4 lxx_o mxx_o   logpop logland loggdp polity religion intensity, cluster(ccode)
outreg2 using "Attacks_c.doc", word dec(2) append label

xtreg Alt_Diff_kill_log  lxx_o mxx_o   logpop logland loggdp polity religion, mle
outreg2 using "nointens.doc", word dec(2) label replace
xtreg Alt_Diff_kill_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion , mle
outreg2 using "nointens.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log  lxx_o mxx_o   logpop logland loggdp polity religion , mle
outreg2 using "nointens.doc", word dec(2) label append
xtreg Alt_Diff_attacks_log Fav4 lxx_o mxx_o   logpop logland loggdp polity religion , mle
outreg2 using "nointens.doc", word dec(2) label append

